package de.koller.zero.engine;

import de.koller.zero.ZeroRoot;
import de.koller.zero.arch.CTTZNode;
import de.koller.zero.arch.ZNode;
import de.koller.zero.engine.control.RealmControl;
import de.koller.zero.view.command.NotifyChanged;

public class ZeroEngine extends CTTZNode {

	public final RealmControl realmControl = new RealmControl();
	private final NotifyChanged notifier = new NotifyChanged();
	
	public ZeroEngine() {
		super( "Engine" );
	}
	
	@Override
	public void generate( ZeroRoot root, Object... references ) {
		super.generate( root, references );
	
		this.addNode( realmControl );
	}

	@Override
	protected void updateAfter() {
		super.updateAfter();
		
		if( notifier.reuse() )
			root.gui.call( notifier );
	}
	
}
